package com.gadgets.busi.bm02.controller;

import com.gadgets.busi.bm02.dto.*;
import com.gadgets.busi.bm02.fegin.ICk3Controller;
import com.gadgets.busi.bm02.fegin.IMcMeterialController;
import com.gadgets.busi.bm02.pojo.MaterialDict;
import com.gadgets.framework.annotation.RoleAuthCheck;
import com.gadgets.framework.common.dto.HttpBaseResp;
import com.gadgets.framework.common.dto.Pagination;
import com.gadgets.framework.common.exception.GadgetsServiceException;
import com.gadgets.framework.common.util.FeginRequestMapUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.HashMap;

/**
 * @author UncleXiu
 * @version V1.0.0
 * @data 2020-11-02
 *
 */
@RestController
@RequestMapping(method = {org.springframework.web.bind.annotation.RequestMethod.POST,org.springframework.web.bind.annotation.RequestMethod.GET},value = "/bm02/ck3")
public class GadgetsBm02Ck3Fork {

    @Autowired
    private ICk3Controller ck3Controller;

    /**
     * 新增配方表
     * @param request                       请求信息
     * @param response                      应答信息
     * @param recipeInfoDTO                 合成表信息
     * @throws GadgetsServiceException      异常信息
     */
    @RoleAuthCheck
    @RequestMapping(method = {org.springframework.web.bind.annotation.RequestMethod.POST,org.springframework.web.bind.annotation.RequestMethod.GET},value = "/addModifyDict.do")
    public void addModifyDict(HttpServletRequest request, HttpServletResponse response, Ck3ModifyDictAddDTO recipeInfoDTO) throws GadgetsServiceException{
        HashMap<String, Object> requestParam = new HashMap<>();
        FeginRequestMapUtil.parseRequestParam(recipeInfoDTO, requestParam);
        ck3Controller.addModifyDict(requestParam);
    }

}
